package com.eatme.web.app.coupon.distribution.dao;

import com.eatme.web.app.coupon.distribution.constant.CouponStatus;
import com.eatme.web.app.coupon.distribution.entity.Coupon;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Coupon Dao 接口定义
 */
public interface CouponDao extends JpaRepository<Coupon,Integer> {

    /**
     * 根据 uerId + 状态寻找优惠券记录
     * @param userId
     * @param status
     * @return
     * where uerId = ... and status = ...
     */
    List<Coupon> findAllByUserIdAndStatus(Long userId, CouponStatus status);


}
